from flask import render_template
from flask.ext.migrate import Migrate, MigrateCommand
from flask.ext.script import Manager

from info import create_app, db, models

app = create_app("dev")

# 创建app脚本管理器对象
manager = Manager(app)

# 将db app 和迁移建立关系
Migrate(app=app, db=db)

# 将迁移的脚本命令添加到manager
manager.add_command("mysql", MigrateCommand)


if __name__ == '__main__':
    manager.run()
